import {request} from "@/utils/request";

// 查询频道信息列表
export function listParentChannel() {
  return request({
    url: '/channel/front/parent',
    method: 'get'
  })
}

export function listChildrenChannel(parentId,pageSize,current) {
  return request({
    url: `/channel/front/children/${parentId}/${pageSize}/${current}`,
    method: 'get'
  })
}

// 查询频道信息详细
export function getChannelById(id) {
  return request({
    url: '/channel/front/' + id,
    method: 'get'
  })
}

// 新增频道信息
export function addChannel(data) {
  return request({
    url: '/channel',
    method: 'post',
    data: data
  })
}

// 修改频道信息
export function updateChannel(data) {
  return request({
    url: '/channel',
    method: 'put',
    data: data
  })
}

// 删除频道信息
export function delChannel(id) {
  return request({
    url: '/channel/' + id,
    method: 'delete'
  })
}

export const searchChannel = (data)=>{
  return request({
    url:`/channel/front/search`,
    method:'post',
    header:{
      isToken: false,
      repeatSubmit: false
    },
    data
  })
}
